//
// Created by Dell on 2021/11/26.
//
#include <iostream>
#include <math.h>
using namespace std;
struct factor{
    int x=0,cnt=0;
}fac[10];

bool isPrime(int x){
    if(x<=1) return false;
    for(int i = 2;i<=(int)sqrt(x);++i){
        if( x%i == 0) return false;
    }
    return true;
}
const int maxn = 1e6;
int prime[maxn],pNum= 0;// 存素数
bool p[maxn] = {false};// 判断是不是合数
void AiShiPrimeInit(){
    for(int i = 2;i<maxn;++i){
        if(p[i] == false){
            prime[pNum++] = i;
            for(int j = 2*i;j<maxn;j+=i){
                p[j] = true;
            }
        }
    }
}

int n = 0;
void fenjie(int x){
    int num = 0;
    printf("%d=",x);
    for(int i = 0;i<pNum&&prime[i]<= (int)sqrt(x);++i){
        if(x%prime[i] == 0){
            fac[num].x = prime[i]; fac[num].cnt = 0;
            while(x%prime[i] == 0){
                fac[num].cnt++;
                x /= prime[i];
            }
            ++num;
        }
    }
    if(!x){
        fac[num].x = n;
        fac[num++].cnt = 1;
    }
    for(int i = 0;i<num;++i){
        if(i>0) printf("*");
        printf("%d",fac[i].x);
        if(fac[i].cnt>1){
            printf("^%d",fac->cnt);
        }
    }
}

int main() {
//    isPrime(5);
    AiShiPrimeInit();
//    for(int i = 0;i<pNum;++i){
//        printf("%d ",prime[i]);
//    }
    scanf("%d",&n);
    if(n == 1)  printf("%s","1=1");

    fenjie(n);
}

